﻿<?php
$sql = "SELECT * FROM LienLac LIMIT 0, 1";

$MaLL = 'NN';
if(isset($MaLL))
{
	$sql = "SELECT * FROM LienLac WHERE MaLL='$MaLL'";
}

$rows = mysql_query($sql);
while($row = mysql_fetch_array($rows))
{
	$TenLL = $row['TenLL'];
	$Email = $row['Email'];
	$DiaChi = $row['DiaChi'];
	$DienThoai = $row['DienThoai'];
	$SoFax = $row['SoFax'];
	$MaLL = $row['MaLL'];
	$Hinh = $row['Hinh'];
	$KinhTuyen = $row['KinhTuyen'];
	$ViTuyen = $row['ViTuyen'];
	$Zoom = $row['Zoom'];
}
?>
<link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

<script type="text/javascript">
    var map;
    
    function initialize() 
    {
    	var lng = <?php echo $ViTuyen?>;	//106.68489587886052;
	    var lat = <?php echo $KinhTuyen?>;	//10.779440989867943;
	    var zoom = <?php echo $Zoom?>;		//16;
    
        var myLatlng = new google.maps.LatLng(lat, lng);
        var myOptions =
		{
		    zoom: zoom,
		    center: myLatlng,
		    mapTypeId: google.maps.MapTypeId.ROADMAP
		}
        map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
        var marker = new google.maps.Marker(
		{
		    position: myLatlng,
		    map: map
		});

        var infowindow = new google.maps.InfoWindow({
            content: $("#InfoWindowContent").html()
        });

        infowindow.open(map, marker);
    }
    window.onload = initialize;
</script>

<style type="text/css">
#map_canvas
{
	position: relative;
	width: 190px;
	height: 143px;
	margin: 10px auto;
}
</style>

<div id="map_canvas"></div>
	
